package com.ibeeking.gmc.global.g.rest.service;

import com.ibeeking.gmc.global.api.common.param.ScriptPublishParam;
import com.ibeeking.gmc.global.service.common.bo.ScriptDatabaseConfigBO;
import com.ibeeking.gmc.global.service.common.param.ScriptPushParam;

import java.util.List;

/**
 * @ClassName ITenantDataPushService
 * @Description
 * @Author ibeeking
 * @Date 2021-03-09 15:37
 **/
public interface ITenantDataPushService {

    /**
     * 执行脚本
     *
     * @param userId
     * @param param
     * @return
     */
    Boolean executeScript(Long userId, ScriptPushParam param);

    /**
     * 发布脚本
     *
     * @param scripts
     * @param tenantIds
     * @param status
     * @return
     */
    Boolean pushScript(String industry, String module, List<ScriptPublishParam> scripts, List<Integer> tenantIds, Integer status);

    /**
     * 查询执行脚本
     *
     * @param tenantId
     * @return
     */
    List<ScriptDatabaseConfigBO> queryExecuteSql(Integer tenantId);

    /**
     * 更新状态
     *
     * @param tenantId
     * @param scriptIds
     * @param count
     * @param status
     * @return
     */
    Boolean updateScriptStatus(Integer tenantId, List<Long> scriptIds, Integer count, Integer status);
}
